const Model = require('./Model')
class Librariesmin extends Model {
    constructor() {
        super()
    }
    structure() {
        // 标准写法
        const Schame = this.Schame
        const mongoose = this.mongoose

        const M =  new Schame({
            name: {
                type: String,
                required: true,
            },
            desc: {
                type: String,
                default: null
            },
            stars: {
                type: Number,
                default: 0,
            }
        })
        
        return mongoose.model('Librariesmin', M)   // 实例化        
    }

}

module.exports = new Librariesmin().structure()